package com.hermes.biz.dao.usermodelextra.impl;

import java.sql.SQLException;

import org.apache.log4j.Logger;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.hermes.biz.common.model.usermodelextra.UserModelExtraDAO;
import com.hermes.biz.common.model.usermodelextra.UserModelExtraDO;


public class UserModelExtraDAOImpl extends SqlMapClientDaoSupport implements UserModelExtraDAO{

	private Logger log = Logger.getLogger(UserModelExtraDAOImpl.class);
	
	public UserModelExtraDO getFansCount(long userId) {
		try {
			Object obj = getSqlMapClientTemplate().getSqlMapClient().queryForList("UserModelExtraDAO.getFansCount",userId).get(0);			
			if(obj!=null)
				return (UserModelExtraDO) obj;
		} catch (SQLException e) {
			log.error(e);
		}		
		return null;
	}

	public UserModelExtraDO getEyeonCount(long userId) {
		try {
			UserModelExtraDO obj = (UserModelExtraDO) getSqlMapClientTemplate().getSqlMapClient().queryForObject("UserModelExtraDAO.getEyeonCount",userId);
			if(obj!=null)
				return obj;
		} catch (SQLException e) {
			log.error(e);
		}		
		return null;
	}

	public UserModelExtraDO getFansIds(long userId) {
		try {
			UserModelExtraDO obj = (UserModelExtraDO) getSqlMapClientTemplate().getSqlMapClient().queryForObject("UserModelExtraDAO.getFansIds",userId);
			if(obj!=null)
				return obj;
		} catch (SQLException e) {
			log.error(e);
		}		
		return null;
	}

	public UserModelExtraDO geteyeonIds(long userId) {
		try {
			UserModelExtraDO obj = (UserModelExtraDO) getSqlMapClientTemplate().getSqlMapClient().queryForList("UserModelExtraDAO.getEyeonIds",userId).get(0);
			if(obj!=null)
				return obj;
		} catch (SQLException e) {
			log.error(e);
		}		
		return null;
	}

}
